(module string mzscheme
  (provide buffer-number
           truncate-string)
  
  (define (buffer-number n)
    "buffer-number returns its argument as a two-or-more-character string."
    (if (< n 10)
        (string-append "0" (number->string n))
        (number->string n)))
  
  (define (truncate-string str max)
    "truncate-string takes a string and a maximum length for that string and truncates that string to max-3, adding an ellipsis."
    (if (< (string-length str) max)
        str
        (string-append (substring str 0 (- max 3)) "..."))))